@extends('admin.main')

@section('content')
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="ibox">
		<div class="ibox-title">
			<h5>Logo 图片</h5>
		</div>
		<div class="ibox-content">
			<div id="queue"></div>
			<input id="file_upload" name="file_upload" type="file" multiple="true" />
      <img id="imgLogo" src="{{$logo}}" class="img-thumbnail img-responsive" />
		</div>
	</div>
</div>
@endsection

@section('pageheader')
<link href="{{asset('assets/uploadify/uploadify.css')}}" rel="stylesheet">
@endsection

@section('pagescript')
<script src="{{asset('assets/uploadify/jquery.uploadify.min.js')}}"></script>
<script>
	$("#side-menu li[rel='siteconfig']").addClass("active")
		.find("ul").addClass("in")
		.find("li[rel='2']").addClass("active");

	$('#file_upload').uploadify({
		"swf": "{{asset('assets/uploadify/uploadify.swf')}}",
		"uploader": "{{url('admin/siteconfig/upload-logo')}}",
		"buttonImage": "{{asset('assets/uploadify/browse.png')}}",
		"formData": {},
		onUploadSuccess: function(file, data, response){
			console.log(data);
			var result = $.parseJSON(data);
			if(result.status == "0"){
				failure(result.msg);
				return;
			}
			$("#imgLogo").attr("src", result.url);
		},
	});
</script>
@endsection
